import request from "@/utils/request.js";

// 获取来访登记列表
export const getVisitListApi = (data, query = {}) => {
    return request({
        method: 'post',
        url: '/bussiness/CheckinLogin/list',
        params: query,
        data: data,
        isEncrypt: false
    })
}

// 创建来访登记
export const createVisitApi = (data) => {
    return request({
        method: 'post',
        url: '/bussiness/CheckinLogin/add',
        data: data,
        isEncrypt: false
    })
}

// 获取来访登记详情内容
export const getVisitDetailApi = (id) => {
    return request({
        method: 'get',
        url: '/bussiness/CheckinLogin/info',
        params: {
            id: id
        },
        isEncrypt: false
    });
}

// 更新来访记录
export const updateVisitApi = (data) => {
    return request({
        method: 'post',
        url: '/bussiness/CheckinLogin/edit',
        data: data,
        isEncrypt: false
    })
}

// 根据身份证 ID 查询历史来访记录
export const getVisitHistoryApi = (data) => {
    return request({
        method: 'post',
        url: '/bussiness/CheckinLogin/listByIdCard',
        data: data,
        isEncrypt: false
    });
}

// 删除来访登记
export const deleteVisitApi = (id) => {
    return request({
        method: 'post',
        url: '/bussiness/CheckinLogin/remove',
        params: {
            id: id
        },
        isEncrypt: false
    })
}